﻿namespace IOP.OpenType
{
    /// <summary>
    /// int16 that describes a quantity in font design units.
    /// </summary>
    public readonly struct FWORD
    {
        private readonly short origin;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="number"></param>
        public FWORD(short number) => origin = number;
        /// <summary>
        /// 隐式转换
        /// </summary>
        /// <param name="fWORD"></param>
        public static implicit operator short(FWORD fWORD) => fWORD.origin;
        /// <summary>
        /// 隐式转换
        /// </summary>
        /// <param name="number"></param>
        public static implicit operator FWORD(short number) => new FWORD(number);
        /// <summary>
        /// 隐式转换
        /// </summary>
        /// <param name="number"></param>
        public static implicit operator FWORD(ushort number) => new FWORD((short)number);
    }
}
